<?php
include_once './common.php';
if(!empty($_GET)){
	$phonenum=$_GET["phonenum"];
	$password=$_GET["password"];
	$sql = "SELECT phonenum FROM study WHERE phonenum='$phonenum'";
	$res=mysqli_query($link,$sql);
	$one=mysqli_fetch_assoc($res);
	$result=array();
	if($one){
		$result['status'] = 0;
		$result['info'] = "手机号已注册";
	}else{
		$sql="INSERT INTO study(phonenum,password) VALUES('$phonenum','$password')";
		$res=mysqli_query($link,$sql);
		$result['status'] = 1;
		$result['info'] = "用户注册成功";
	}
	
	echo json_encode($result);

}
?>